package com.ydkj.a37e_mall.Classes.Model.Request;

import android.util.Log;

import com.ydkj.a37e_mall.Resource.Utils.Rsa;

import static com.ydkj.a37e_mall.Classes.Acitivity.BaseActivity.BaseActivity.page;

/**
 * Created by Administrator on 2017/3/4.
 */

public class BindOauthReq {
    private String open_id;
    private String type;
    private String nickname;
    private String avatar;
    private String secret;

    public String getOpen_id() {
        return open_id;
    }

    public void setOpen_id(String open_id) {
        this.open_id = open_id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String urlString() {
        return "oauth/bind_oauth/";
    }

    public String getSecret() {

        String string = "open_id=" + open_id + "&type=" + type + "&nickname=" + nickname + "&avatar=" + avatar;
        try {
            Rsa rsa = new Rsa();
            secret = rsa.encryptByPublic(string);
        } catch (Exception e) {
            e.printStackTrace();
        }
        Log.e("ssss", "手机号绑定第三方_source===>" + string);
        return secret;
    }
}
